package com.ziJin.mapper;

import com.ziJin.pojo.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select * from students where ID = #{id}")
    Student getInfo(Integer id);

    @Select("select * from students")
    List<Student> findAll();

    @Delete("delete from students where ID = #{id}")
    void deleteById(Integer id);

    @Insert("insert into students values (null,#{studentNum},#{name},#{phone},#{email},#{createTime},#{updateTime})")
    void save(Student student);

    void update(Student student);

    List<Student> findByInfo(String studentNum, String name);
}
